// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "Camera/PlayerCameraManager.h"

#include "LyraUICameraManagerComponent.generated.h"

class ALyraPlayerCameraManager;

class AActor;
class AHUD;
class APlayerController;
class FDebugDisplayInfo;
class UCanvas;
class UObject;

UCLASS( Transient, Within=LyraPlayerCameraManager )
class ULyraUICameraManagerComponent : public UActorComponent
{
	GENERATED_BODY()

public:
	static ULyraUICameraManagerComponent* GetComponent(APlayerController* PC); // 静态方法获取组件

public:
	ULyraUICameraManagerComponent();	
	virtual void InitializeComponent() override; // 初始化组件

	bool IsSettingViewTarget() const { return bUpdatingViewTarget; } // 是否正在设置视角目标
	AActor* GetViewTarget() const { return ViewTarget; } // 获取视角目标
	void SetViewTarget(AActor* InViewTarget, FViewTargetTransitionParams TransitionParams = FViewTargetTransitionParams()); // 设置视角目标

	bool NeedsToUpdateViewTarget() const; // 是否需要更新视角目标
	void UpdateViewTarget(struct FTViewTarget& OutVT, float DeltaTime); // 更新视角目标

	void OnShowDebugInfo(AHUD* HUD, UCanvas* Canvas, const FDebugDisplayInfo& DisplayInfo, float& YL, float& YPos); // 显示调试信息

private:
	UPROPERTY(Transient)
	TObjectPtr<AActor> ViewTarget; // 视角目标
	
	UPROPERTY(Transient)
	bool bUpdatingViewTarget; // 正在更新视角目标标志
};